﻿@model PagedList.StaticPagedList<Guan.CMS.Web.ViewModels.Article.ArticleSummaryViewModel>
@using Guan.CMS.Common.Framework
@using PagedList.Mvc
@{
    Layout = "~/Views/Shared/_LayoutNew.cshtml";
    bool isLeftPic = true;
}

<!-- Content -->
<div id="content">
    <div class="shell">
        <!-- Featured Area -->
        <div class="featured-area">
            <h2>公司新闻</h2>
            @*<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc ornare consequat tortor quis lorem ipsum dolor sit amet, consectetur </p>*@
            <span class="shadow"></span>
        </div>
        <!-- END Featured Area -->
        <!-- Blog -->
        <div class="blog">
            <div class="blog-bottom">
                <div class="blog-top">
                    <!-- Widecolumn -->
                    <div class="widecolumn fl">
                        @if (Model.Any())
                        {
                            foreach (var article in Model)
                            {
                                <!-- Post -->
                                <section class="post">
                                    <section class="post-header">
                                        <div class="fr">
                                            <ul>
                                                @*<li class="comments"><a href="#">8</a> comments</li>*@
                                                <li><em>@article.CreatedTime</em></li>
                                            </ul>
                                        </div>

                                        <h2 class="fl">@Html.ActionLink(article.Title, "Detail", "News", new {id = article.Id}, new{title=article.Title,target="_blank"})</h2>
                                        @*<span class="meta fl">Posted in:  <strong><a href="#">Web Design</a></strong></span>*@
                                        <div class="cl">&nbsp;</div>
                                    </section>
                                    <section class="post-entry">
                                        @if (!string.IsNullOrWhiteSpace(article.FirstImage))
                                        {
                                            <a><img style="margin-right:1em;" src="@(article.FirstImage)" width="267" height="210" alt="" class="@(isLeftPic?"fl":"fr")" /></a>
                                        }
                                        <p>@article.BodyText.CutString(300)</p>
                                        <div class="cl"></div>
                                    </section>
                                    <section class="post-footer">
                                        @*<div class="meta fr">
                                            Tags:  <strong><a href="#">Design</a></strong>  <strong><a href="#">Templates</a></strong>  <strong><a href="#">Creative</a></strong>
                                        </div>*@
                                        <a href="@Url.Action("Detail", new { article.Id })" target="_blank" class="btn-1"><span>查看全文</span></a>
                                    </section>
                                </section>
                                <!-- END Post -->
                                isLeftPic = !isLeftPic;
                            }
                        }
                        <!-- Paging -->
                        <section class="paging">
                            @Html.PagedListPager(Model,page => Url.Action("Index",new{page=page}))
                            @*<ul>
                                <li><a href="#">&laquo;</a></li>
                                <li><a href="#" class="active">1</a></li>
                                <li><a href="#">2</a></li>
                                <li><a href="#">3</a></li>
                                <li><a href="#">4</a></li>
                                <li><a href="#">5</a></li>
                                <li><a href="#">&raquo;</a></li>
                                <li><a href="#">10</a></li>
                                <li><span>...</span></li>
                                <li><a href="#">Last</a></li>
                            </ul>*@
                        </section>
                        <!-- END Paging -->
                    </div>
                    <!-- END Widecolumn -->
                    <!-- Sidebar -->
                    <aside class="fr">
                        <ul>
                            <li>
                                <h3>产品分类</h3>
                                @Html.Action("Category","Products")
                            </li>
                            @*<li>
                                <h3>广告</h3>
                                <ul class="ads">
                                    <li><a href="#"><img src="css/images/ad-banner-1.jpg" width="115" height="72" alt="" /></a></li>
                                    <li><a href="#"><img src="css/images/ad-banner-2.jpg" width="115" height="72" alt="" /></a></li>
                                </ul>
                            </li>*@
                        </ul>
                    </aside>
                    <!-- END Sidebar -->
                    <div class="cl">&nbsp;</div>
                </div>
            </div>
        </div>
        <!-- END Blog -->
        <div class="cl">&nbsp;</div>
    </div>
</div>
<!-- END Content -->